/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 * Origin source from MaNGOS(GPL2).
 * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
 */

#ifndef __CONFIG_H__
#define __CONFIG_H__

#include "Common.h"
#include "PlatformDef.h"

class ACE_Configuration_Heap;

namespace PQServiceCore
{
	class Config
	{
	public:
		Config();
		~Config();
		static Config& getSingleton();

		bool setSource(const char *file);
		bool reload();

		std::string getStringDefault(const char* name, const char* def);
		bool getBoolDefault(const char* name, const bool def = false);
		int32 getIntDefault(const char* name, const int32 def);
		float getFloatDefault(const char* name, const float def);

		inline std::string getFileName() const { return _filename; }

	private:
		std::string _filename;
		ACE_Configuration_Heap *_config;

	};
}

#define SConfig PQServiceCore::Config::getSingleton()

#endif
